<%@ page import="java.util.List, com.bobamrz.model.Camera" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	<link rel="stylesheet" type="text/css" href="css/camera_list.css">
	<script src="js/camera_list.js"></script>
	<script src="js/jquery-1.9.1.js"></script>
	
	<title>Insert title here</title>
</head>
<body>
	<a href='s'>servlet</a> | <a href='http://imbi.ld.ttu.ee/tomcat_webapp_logs/camera/log.txt'>log.txt</a><br>
	
	<table>
		<tr>
			<td>Model</td>
			<td>Description</td>
			<td>Sensor resolution (Mpx)</td>
			<td>Edit</td>
		</tr>
		<%
			List<Camera> cameras = (List<Camera>)request.getAttribute("cameras");
				for (Camera camera : cameras) {
			out.print("<tr>");
			out.print("<td>");
			if (camera.getModel() != null) {
				out.print(camera.getModel());
			}
			out.print("</td>");
			out.print("<td>");
			out.print("<a href=\"javascript:getDescription("+camera.getId()+")\">");
			out.print("Description");
			out.print("</a>");
			out.print("</td>");
			out.print("<td>");
			out.print(camera.getSensorResolutionInMegapixels());
			out.print("</td>");
			out.print("<td><a href=\"s?id="+camera.getId()+"\">EDIT</td>");
			out.print("</tr>");
				}
		%>
	</table>
	<div id="ajax_content">
		
	</div>
</body>
</html>